package com.qdxwx.data.mapper.favorite;

import com.qdxwx.common.page.PageRequest;
import com.qdxwx.models.favorite.Favorite;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */
@Repository
public interface FavoriteMapper {

	int insert(Favorite favorite);

	int deleteById(int id);

	int deleteByFavorite(Favorite favorite);

	int isExist(long userId, int courseId, int typeId);

	Favorite selectById(int id);

	List<Favorite> selectList(@Param("userId") Long userId, @Param("typeId") int typeId, @Param("page") PageRequest page);

	int count(@Param("userId") long userId,  @Param("typeId") int typeId);

    int updateCombine(long userId1, long userId2);
}